package net.stogi.unicore.beyond.ui.client.taskeditor.propertyeditor;

import net.stogi.unicore.beyond.api.model.PropertyValue;

import com.google.gwt.event.shared.GwtEvent;

public class PropertyChangedEvent extends GwtEvent<PropertyChangedHandler> {

	public static final GwtEvent.Type<PropertyChangedHandler> TYPE = new GwtEvent.Type<PropertyChangedHandler>();

	private PropertyValue property;
	
	public PropertyChangedEvent(PropertyValue property) {
		this.property = property;
	}

	@SuppressWarnings("unused")
	private PropertyChangedEvent() {}

	@Override
	public Type<PropertyChangedHandler> getAssociatedType() {
		return TYPE;
	}

	public PropertyValue getProperty() {
		return property;
	}

	public void setProperty(PropertyValue property) {
		this.property = property;
	}

	@Override
	protected void dispatch(PropertyChangedHandler handler) {
		handler.onPropertyChanged(this);
	}
}
